﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Mvc.XForms.Controls.Settings {
	public class GroupSettings<TContext> {
		public IGroup<TContext> Group { get; private set; }

		public GroupSettings(IGroup<TContext> group) {
			Group = group;
		}

		public void Template(Action<IGroup<TContext>> groupTemplate) {
			Group.TemplateAction = groupTemplate;
			Group.Render();
		}

		public GroupSettings<TContext> Tag(string tag) {
			Group.Tag = tag;
			return this;
		}

		public GroupSettings<TContext> Label(string label) {
			Group.Label = label;
			return this;
		}

		public GroupSettings<TContext> Attr(string name, string value) {
			Group.Attributes.Add(name, value);
			return this;
		}
	}
}
